﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.Infrastructure.Common;
using Zocono.WCS.Domain.EquipmentLayoutManageDomain;
using Zocono.WCS.Infrastructure.ApllicationDto;
using Zocono.WCS.Infrastructure.ApllicationDto.DtoWcsManage;

namespace Zocono.WCS.Application.AppEquipmentLayoutManage
{
    public class EquipmentLayoutApp
    {
        private readonly IMapper _Mapper;
        private readonly IEquipmentLayoutService _EquipmentLayoutservice;
        private readonly IEquipmentLayoutTypeService _EquipmentLayoutTypeservice;


        public EquipmentLayoutApp(IMapper mapper, IEquipmentLayoutService EquipmentLayoutservice, IEquipmentLayoutTypeService EquipmentLayoutTypeservice)
        {
            _Mapper = mapper;
            _EquipmentLayoutservice = EquipmentLayoutservice;
            _EquipmentLayoutTypeservice = EquipmentLayoutTypeservice;
        }

        #region 设备布局
        public async Task<long> AddEquipmentLayoutAsync(EquipmentLayoutInfoDto EquipmentLayoutInfoDto)
        {
            EquipmentLayoutInfoDto.ObjectIsNullOrEmpty();//数据非空验证
            return await _EquipmentLayoutservice.AddEquipmentLayoutAsync(EquipmentLayoutInfoDto);
        }

        public async Task<bool> DeleteEquipmentLayoutAsync(long ID)
        {
            return await _EquipmentLayoutservice.DeleteEquipmentLayoutAsync(ID);
        }

        public async Task<bool> UpdateEquipmentLayoutAsync(EquipmentLayoutInfoDto EquipmentLayoutInfoDto)
        {
            EquipmentLayoutInfoDto.ObjectIsNullOrEmpty();
            return await _EquipmentLayoutservice.UpdateEquipmentLayoutAsync(EquipmentLayoutInfoDto);
        }

        public async Task<PageDto<EquipmentLayoutInfoDto>> GetEquipmentLayoutAsync(QueryEquipmentLayoutInfoDto queryEquipmentLayoutInfoDto)
        {
            return await _EquipmentLayoutservice.GetEquipmentLayoutAsync(queryEquipmentLayoutInfoDto);
        }

        public async Task<EquipmentLayoutInfoDto> GetEquipmentLayoutByIDAsync(long ID)
        {
            return await _EquipmentLayoutservice.GetEquipmentLayoutByIDAsync(ID);
        }
        #endregion


        #region 设备布局类型
        public async Task<long> AddEquipmentLayoutTypeAsync(EquipmentLayoutTypeInfoDto EquipmentLayoutTypeInfoDto)
        {
            EquipmentLayoutTypeInfoDto.ObjectIsNullOrEmpty();//数据非空验证
            return await _EquipmentLayoutTypeservice.AddEquipmentLayoutTypeAsync(EquipmentLayoutTypeInfoDto);
        }

        public async Task<bool> DeleteEquipmentLayoutTypeAsync(long ID)
        {
            return await _EquipmentLayoutTypeservice.DeleteEquipmentLayoutTypeAsync(ID);
        }

        public async Task<bool> UpdateEquipmentLayoutTypeAsync(EquipmentLayoutTypeInfoDto EquipmentLayoutTypeInfoDto)
        {
            EquipmentLayoutTypeInfoDto.ObjectIsNullOrEmpty();
            return await _EquipmentLayoutTypeservice.UpdateEquipmentLayoutTypeAsync(EquipmentLayoutTypeInfoDto);
        }

        public async Task<PageDto<EquipmentLayoutTypeInfoDto>> GetEquipmentLayoutTypeAsync(QueryEquipmentLayoutTypeInfoDto queryEquipmentLayoutTypeInfoDto)
        {
            return await _EquipmentLayoutTypeservice.GetEquipmentLayoutTypeAsync(queryEquipmentLayoutTypeInfoDto);
        }

        public async Task<EquipmentLayoutTypeInfoDto> GetEquipmentLayoutTypeByIDAsync(long ID)
        {
            return await _EquipmentLayoutTypeservice.GetEquipmentLayoutTypeByIDAsync(ID);
        }
        #endregion 
    }
}
